package jp.ircbot.kaitvip.facade;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import jp.ircbot.kaitvip.bo.FileIO;
import jp.ircbot.kaitvip.common.SuperFacade;
import jp.ircbot.kaitvip.common.bean.SendMessageBean;
import jp.ircbot.kaitvip.common.cif.SuperBeanIF;

public class TestFacade extends SuperFacade {

	@Override
	public List<SendMessageBean> execute() {
		List<SendMessageBean> returnMessage = new ArrayList<SendMessageBean>();
		SendMessageBean errorMessage = new SendMessageBean();
		errorMessage.setChannel(this.messageBean.getChannel());
		returnMessage.add(errorMessage);

		List<SuperBeanIF> messageList = new ArrayList<SuperBeanIF>();
		messageList.add(this.messageBean);
		try {
			FileIO.writeCSVFile(messageList, "messageFile");
		} catch (FileNotFoundException exc) {
			exc.printStackTrace();
			//returnMessage.get(0).setMessage("失敗しました");
			//return returnMessage;
		}
		returnMessage.get(0).setMessage("多分成功しました");
		return returnMessage;
	}

}
